package org.jtzc.springaiagent.agent.router;

import org.jtzc.springaiagent.agent.BaseAgent;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author wu chuang
 * @description 销售
 */
@Service
public class SalesAgent implements BaseAgent {

    @Autowired
    private ChatClient chatClient;


    @Override
    public AgentResponse execute(AgentRequest request) {
        String system = "你做为一个销售专业领域的知识,帮助用户从销售领域给出专业的回答";
        String response = chatClient.prompt().system(system).user(request.prompt()).call().content();
        return new AgentResponse(response, Map.of("SalesAgent", "gpt-4"));
    }
}
